//
//  AppDelegate.swift
//  WBSwift
//
//  Created by maker on 11/8/16.
//  Copyright © 2016 maker. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    var defauletVC :UIViewController{
        let isLogin = UserInfoViewModel.shareInstance.isLogin
        return isLogin ? WelcomeVC() : UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()!
    }
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        //0.设置全局颜色
        UITabBar.appearance().tintColor = UIColor.orange
        UINavigationBar.appearance().tintColor = UIColor.orange
        
        //1.设置窗口
        window = UIWindow(frame:UIScreen.main.bounds)
        window?.rootViewController = defauletVC
        window?.makeKeyAndVisible()
//        mprint(UserInfoViewModel.shareInstance.user?.access_token)
//        mprint(UserInfoViewModel.shareInstance.homePath)
        
        return true
    }

}
func mprint<T>(_ message:T,file:String = #file,line:Int = #line){
    #if DEBUG
    let fileName = (file as NSString).lastPathComponent
    print("\(fileName)---\(line)---\(message)")
    #endif
}




